import 'dart:async';

import 'package:flutter/services.dart';

class TearchPlugin {
  static const MethodChannel _channel = const MethodChannel('tearch_plugin');

  static Future<String> get platformVersion async {
    final String version = await _channel.invokeMethod('getPlatformVersion');
    return version;
  }

  static Future<String> get previewFile async {
    await _channel.invokeMethod('previewFile', {"filePath": "pssssssse"});
  }

  static Future<String> get openMarket async {
    await _channel
        .invokeMethod('openMarket', {"packageName": "com.xwy.tearchs"});
  }

  static Future<String> get getBssid async {
    final String bssid = await _channel.invokeMethod('getBssid');
    return bssid == null ? null : bssid.toUpperCase();
  }

  static Future<bool> get isOpen async {
    final bool isOpen = await _channel.invokeMethod('isOpen');
    return isOpen;
  }

  static Future get openGps async {
    await _channel.invokeMethod('openGps');
  }
}
